<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="质检单号" prop="checkNo">
        <el-input
          v-model="queryParams.checkNo"
          placeholder="请输入质检单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="订单号" prop="orderId">
        <el-input
          v-model="queryParams.orderId"
          placeholder="请输入订单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="排产号" prop="productionId">
        <el-input
          v-model="queryParams.productionId"
          placeholder="请输入排产号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="检验类别" prop="checkType1">
        <el-input
          v-model="queryParams.checkType1"
          placeholder="请输入检验类别"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="检验类型" prop="checkType2">
        <el-input
          v-model="queryParams.checkType2"
          placeholder="请输入检验类型"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="收货日期" prop="shDate">
        <el-date-picker clearable
          v-model="queryParams.shDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择收货日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="报检日期" prop="bjDate">
        <el-date-picker clearable
          v-model="queryParams.bjDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择报检日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="检验日期" prop="checkDate">
        <el-date-picker clearable
          v-model="queryParams.checkDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择检验日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="仓库编号" prop="stockId">
        <el-input
          v-model="queryParams.stockId"
          placeholder="请输入仓库编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="仓库名称" prop="stockName">
        <el-input
          v-model="queryParams.stockName"
          placeholder="请输入仓库名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="库位编码" prop="kuweiCode">
        <el-input
          v-model="queryParams.kuweiCode"
          placeholder="请输入库位编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="批次号" prop="lot">
        <el-input
          v-model="queryParams.lot"
          placeholder="请输入批次号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="物料大类id" prop="classId1">
        <el-input
          v-model="queryParams.classId1"
          placeholder="请输入物料大类id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="物料大类" prop="className1">
        <el-input
          v-model="queryParams.className1"
          placeholder="请输入物料大类"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="物料类型id" prop="classId2">
        <el-input
          v-model="queryParams.classId2"
          placeholder="请输入物料类型id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="物料类型" prop="className2">
        <el-input
          v-model="queryParams.className2"
          placeholder="请输入物料类型"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="物料图号" prop="itemCode">
        <el-input
          v-model="queryParams.itemCode"
          placeholder="请输入物料图号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="物料名称" prop="itemName">
        <el-input
          v-model="queryParams.itemName"
          placeholder="请输入物料名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="物料子图号" prop="itemId">
        <el-input
          v-model="queryParams.itemId"
          placeholder="请输入物料子图号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="规格型号" prop="spec">
        <el-input
          v-model="queryParams.spec"
          placeholder="请输入规格型号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="检验标准" prop="checkBz">
        <el-input
          v-model="queryParams.checkBz"
          placeholder="请输入检验标准"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="收货数量" prop="shNum">
        <el-input
          v-model="queryParams.shNum"
          placeholder="请输入收货数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="库存数量" prop="kcNum">
        <el-input
          v-model="queryParams.kcNum"
          placeholder="请输入库存数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="送检数量" prop="sjNum">
        <el-input
          v-model="queryParams.sjNum"
          placeholder="请输入送检数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="抽检数量" prop="cjNum">
        <el-input
          v-model="queryParams.cjNum"
          placeholder="请输入抽检数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="合格数量" prop="hgNum">
        <el-input
          v-model="queryParams.hgNum"
          placeholder="请输入合格数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="不合格数量" prop="bhgNum">
        <el-input
          v-model="queryParams.bhgNum"
          placeholder="请输入不合格数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="机加返修数量" prop="jjfxNum">
        <el-input
          v-model="queryParams.jjfxNum"
          placeholder="请输入机加返修数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="锻打返修数量" prop="ddfxNum">
        <el-input
          v-model="queryParams.ddfxNum"
          placeholder="请输入锻打返修数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="机废数量" prop="jfNum">
        <el-input
          v-model="queryParams.jfNum"
          placeholder="请输入机废数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="废料数量" prop="flNum">
        <el-input
          v-model="queryParams.flNum"
          placeholder="请输入废料数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="材质废品数量" prop="czfpNum">
        <el-input
          v-model="queryParams.czfpNum"
          placeholder="请输入材质废品数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="生产者工号" prop="sczNo">
        <el-input
          v-model="queryParams.sczNo"
          placeholder="请输入生产者工号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="生产者姓名" prop="sczName">
        <el-input
          v-model="queryParams.sczName"
          placeholder="请输入生产者姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="质检员工号" prop="zjyNo">
        <el-input
          v-model="queryParams.zjyNo"
          placeholder="请输入质检员工号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="质检员姓名" prop="zjyName">
        <el-input
          v-model="queryParams.zjyName"
          placeholder="请输入质检员姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="判定质量状态" prop="pdzlState">
        <el-input
          v-model="queryParams.pdzlState"
          placeholder="请输入判定质量状态"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['business:qualityCheckInfo:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['business:qualityCheckInfo:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['business:qualityCheckInfo:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['business:qualityCheckInfo:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="qualityCheckInfoList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="主键" align="center" prop="id" />
      <el-table-column label="公司名称" align="center" prop="factoryName" />
      <el-table-column label="公司代码" align="center" prop="factoryCode" />
      <el-table-column label="质检单号" align="center" prop="checkNo" />
      <el-table-column label="订单类型" align="center" prop="orderType" />
      <el-table-column label="订单号" align="center" prop="orderId" />
      <el-table-column label="排产号" align="center" prop="productionId" />
      <el-table-column label="检验类别" align="center" prop="checkType1">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.check_type1" :value="scope.row.checkType1"/>
        </template>
      </el-table-column>
      <el-table-column label="检验类型" align="center" prop="checkType2">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.check_type2" :value="scope.row.checkType2"/>
        </template>
      </el-table-column>
      <el-table-column label="收货日期" align="center" prop="shDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.shDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="报检日期" align="center" prop="bjDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.bjDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="检验日期" align="center" prop="checkDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.checkDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="仓库编号" align="center" prop="stockId" />
      <el-table-column label="仓库名称" align="center" prop="stockName" />
      <el-table-column label="库位编码" align="center" prop="kuweiCode" />
      <el-table-column label="批次号" align="center" prop="lot" />
      <el-table-column label="物料大类id" align="center" prop="classId1" />
      <el-table-column label="物料大类" align="center" prop="className1" />
      <el-table-column label="物料类型id" align="center" prop="classId2" />
      <el-table-column label="物料类型" align="center" prop="className2" />
      <el-table-column label="物料图号" align="center" prop="itemCode" />
      <el-table-column label="物料名称" align="center" prop="itemName" />
      <el-table-column label="物料子图号" align="center" prop="itemId" />
      <el-table-column label="规格型号" align="center" prop="spec" />
      <el-table-column label="检验标准" align="center" prop="checkBz" />
      <el-table-column label="收货数量" align="center" prop="shNum" />
      <el-table-column label="库存数量" align="center" prop="kcNum" />
      <el-table-column label="送检数量" align="center" prop="sjNum" />
      <el-table-column label="抽检数量" align="center" prop="cjNum" />
      <el-table-column label="合格数量" align="center" prop="hgNum" />
      <el-table-column label="不合格数量" align="center" prop="bhgNum" />
      <el-table-column label="机加返修数量" align="center" prop="jjfxNum" />
      <el-table-column label="锻打返修数量" align="center" prop="ddfxNum" />
      <el-table-column label="机废数量" align="center" prop="jfNum" />
      <el-table-column label="废料数量" align="center" prop="flNum" />
      <el-table-column label="材质废品数量" align="center" prop="czfpNum" />
      <el-table-column label="生产者工号" align="center" prop="sczNo" />
      <el-table-column label="生产者姓名" align="center" prop="sczName" />
      <el-table-column label="质检员工号" align="center" prop="zjyNo" />
      <el-table-column label="质检员姓名" align="center" prop="zjyName" />
      <el-table-column label="判定质量状态" align="center" prop="pdzlState" />
      <el-table-column label="公称通径DN " align="center" prop="gctjDn" />
      <el-table-column label="钢管外径系列I" align="center" prop="ggwj1" />
      <el-table-column label="钢管外径系列Ⅱ" align="center" prop="ggwj2" />
      <el-table-column label="法兰外径D" align="center" prop="flwjD" />
      <el-table-column label="法兰孔中心圆直径K" align="center" prop="flkzxyzjK" />
      <el-table-column label="法兰孔径L" align="center" prop="flkjL" />
      <el-table-column label="法兰孔数n" align="center" prop="flksN" />
      <el-table-column label="法兰螺栓规格" align="center" prop="fllsSpec" />
      <el-table-column label="法兰厚度C" align="center" prop="flhdC" />
      <el-table-column label="法兰密封面尺寸d" align="center" prop="flmfmccD" />
      <el-table-column label="法兰台高f" align="center" prop="fltgF" />
      <el-table-column label="法兰内径系列I" align="center" prop="flnj1" />
      <el-table-column label="法兰内径系列Ⅱ" align="center" prop="flnj2" />
      <el-table-column label="法兰理论重量(kg)平面FF系列I" align="center" prop="flllzlpm1Ff" />
      <el-table-column label="法兰理论重量(kg)平面FF系列Ⅱ" align="center" prop="flllzlpm2Ff" />
      <el-table-column label="法兰理论重量(kg)突面RF系列I" align="center" prop="flllzltm1Rf" />
      <el-table-column label="法兰理论重量(kg)突面RF系列IⅡ" align="center" prop="flllzltm2Rf" />
      <el-table-column label="法兰盖厚度C" align="center" prop="flghdC" />
      <el-table-column label="法兰盖理论重量平面FF" align="center" prop="flgllzlpmFf" />
      <el-table-column label="法兰盖理论重量突面RF" align="center" prop="flgllzlpmRf" />
      <el-table-column label="材质检验1标准" align="center" prop="checkBz1" />
      <el-table-column label="材质检验1结果" align="center" prop="checkJg1" />
      <el-table-column label="材质检验2标准" align="center" prop="checkBz2" />
      <el-table-column label="材质检验2结果" align="center" prop="checkJg2" />
      <el-table-column label="材质检验3标准" align="center" prop="checkBz3" />
      <el-table-column label="材质检验3结果" align="center" prop="checkJg3" />
      <el-table-column label="材质检验4标准" align="center" prop="checkBz4" />
      <el-table-column label="材质检验4结果" align="center" prop="checkJg4" />
      <el-table-column label="材质检验5标准" align="center" prop="checkBz5" />
      <el-table-column label="材质检验5结果" align="center" prop="checkJg5" />
      <el-table-column label="材质检验6标准" align="center" prop="checkBz6" />
      <el-table-column label="材质检验6结果" align="center" prop="checkJg6" />
      <el-table-column label="材质检验7标准" align="center" prop="checkBz7" />
      <el-table-column label="材质检验7结果" align="center" prop="checkJg7" />
      <el-table-column label="材质检验8标准" align="center" prop="checkBz8" />
      <el-table-column label="材质检验8结果" align="center" prop="checkJg8" />
      <el-table-column label="材质检验9标准" align="center" prop="checkBz9" />
      <el-table-column label="材质检验9结果" align="center" prop="checkJg9" />
      <el-table-column label="材质检验10标准" align="center" prop="checkBz10" />
      <el-table-column label="材质检验10结果" align="center" prop="checkJg10" />
      <el-table-column label="核定标记" align="center" prop="hdFlag" />
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['business:qualityCheckInfo:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['business:qualityCheckInfo:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改质量检验记录对话框 -->
    <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="公司名称" prop="factoryName">
          <el-input v-model="form.factoryName" placeholder="请输入公司名称" />
        </el-form-item>
        <el-form-item label="公司代码" prop="factoryCode">
          <el-input v-model="form.factoryCode" placeholder="请输入公司代码" />
        </el-form-item>
        <el-form-item label="质检单号" prop="checkNo">
          <el-input v-model="form.checkNo" placeholder="请输入质检单号" />
        </el-form-item>
        <el-form-item label="订单号" prop="orderId">
          <el-input v-model="form.orderId" placeholder="请输入订单号" />
        </el-form-item>
        <el-form-item label="排产号" prop="productionId">
          <el-input v-model="form.productionId" placeholder="请输入排产号" />
        </el-form-item>
        <el-form-item label="检验类别" prop="checkType1">
          <el-input v-model="form.checkType1" placeholder="请输入检验类别" />
        </el-form-item>
        <el-form-item label="检验类型" prop="checkType2">
          <el-input v-model="form.checkType2" placeholder="请输入检验类型" />
        </el-form-item>
        <el-form-item label="收货日期" prop="shDate">
          <el-date-picker clearable
            v-model="form.shDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择收货日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="报检日期" prop="bjDate">
          <el-date-picker clearable
            v-model="form.bjDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择报检日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="检验日期" prop="checkDate">
          <el-date-picker clearable
            v-model="form.checkDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择检验日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="仓库编号" prop="stockId">
          <el-input v-model="form.stockId" placeholder="请输入仓库编号" />
        </el-form-item>
        <el-form-item label="仓库名称" prop="stockName">
          <el-input v-model="form.stockName" placeholder="请输入仓库名称" />
        </el-form-item>
        <el-form-item label="库位编码" prop="kuweiCode">
          <el-input v-model="form.kuweiCode" placeholder="请输入库位编码" />
        </el-form-item>
        <el-form-item label="批次号" prop="lot">
          <el-input v-model="form.lot" placeholder="请输入批次号" />
        </el-form-item>
        <el-form-item label="物料大类id" prop="classId1">
          <el-input v-model="form.classId1" placeholder="请输入物料大类id" />
        </el-form-item>
        <el-form-item label="物料大类" prop="className1">
          <el-input v-model="form.className1" placeholder="请输入物料大类" />
        </el-form-item>
        <el-form-item label="物料类型id" prop="classId2">
          <el-input v-model="form.classId2" placeholder="请输入物料类型id" />
        </el-form-item>
        <el-form-item label="物料类型" prop="className2">
          <el-input v-model="form.className2" placeholder="请输入物料类型" />
        </el-form-item>
        <el-form-item label="物料图号" prop="itemCode">
          <el-input v-model="form.itemCode" placeholder="请输入物料图号" />
        </el-form-item>
        <el-form-item label="物料名称" prop="itemName">
          <el-input v-model="form.itemName" placeholder="请输入物料名称" />
        </el-form-item>
        <el-form-item label="物料子图号" prop="itemId">
          <el-input v-model="form.itemId" placeholder="请输入物料子图号" />
        </el-form-item>
        <el-form-item label="规格型号" prop="spec">
          <el-input v-model="form.spec" placeholder="请输入规格型号" />
        </el-form-item>
        <el-form-item label="检验标准" prop="checkBz">
          <el-input v-model="form.checkBz" placeholder="请输入检验标准" />
        </el-form-item>
        <el-form-item label="收货数量" prop="shNum">
          <el-input v-model="form.shNum" placeholder="请输入收货数量" />
        </el-form-item>
        <el-form-item label="库存数量" prop="kcNum">
          <el-input v-model="form.kcNum" placeholder="请输入库存数量" />
        </el-form-item>
        <el-form-item label="送检数量" prop="sjNum">
          <el-input v-model="form.sjNum" placeholder="请输入送检数量" />
        </el-form-item>
        <el-form-item label="抽检数量" prop="cjNum">
          <el-input v-model="form.cjNum" placeholder="请输入抽检数量" />
        </el-form-item>
        <el-form-item label="合格数量" prop="hgNum">
          <el-input v-model="form.hgNum" placeholder="请输入合格数量" />
        </el-form-item>
        <el-form-item label="不合格数量" prop="bhgNum">
          <el-input v-model="form.bhgNum" placeholder="请输入不合格数量" />
        </el-form-item>
        <el-form-item label="机加返修数量" prop="jjfxNum">
          <el-input v-model="form.jjfxNum" placeholder="请输入机加返修数量" />
        </el-form-item>
        <el-form-item label="锻打返修数量" prop="ddfxNum">
          <el-input v-model="form.ddfxNum" placeholder="请输入锻打返修数量" />
        </el-form-item>
        <el-form-item label="机废数量" prop="jfNum">
          <el-input v-model="form.jfNum" placeholder="请输入机废数量" />
        </el-form-item>
        <el-form-item label="废料数量" prop="flNum">
          <el-input v-model="form.flNum" placeholder="请输入废料数量" />
        </el-form-item>
        <el-form-item label="材质废品数量" prop="czfpNum">
          <el-input v-model="form.czfpNum" placeholder="请输入材质废品数量" />
        </el-form-item>
        <el-form-item label="生产者工号" prop="sczNo">
          <el-input v-model="form.sczNo" placeholder="请输入生产者工号" />
        </el-form-item>
        <el-form-item label="生产者姓名" prop="sczName">
          <el-input v-model="form.sczName" placeholder="请输入生产者姓名" />
        </el-form-item>
        <el-form-item label="质检员工号" prop="zjyNo">
          <el-input v-model="form.zjyNo" placeholder="请输入质检员工号" />
        </el-form-item>
        <el-form-item label="质检员姓名" prop="zjyName">
          <el-input v-model="form.zjyName" placeholder="请输入质检员姓名" />
        </el-form-item>
        <el-form-item label="判定质量状态" prop="pdzlState">
          <el-input v-model="form.pdzlState" placeholder="请输入判定质量状态" />
        </el-form-item>
        <el-form-item label="公称通径DN " prop="gctjDn">
          <el-input v-model="form.gctjDn" placeholder="请输入公称通径DN " />
        </el-form-item>
        <el-form-item label="钢管外径系列I" prop="ggwj1">
          <el-input v-model="form.ggwj1" placeholder="请输入钢管外径系列I" />
        </el-form-item>
        <el-form-item label="钢管外径系列Ⅱ" prop="ggwj2">
          <el-input v-model="form.ggwj2" placeholder="请输入钢管外径系列Ⅱ" />
        </el-form-item>
        <el-form-item label="法兰外径D" prop="flwjD">
          <el-input v-model="form.flwjD" placeholder="请输入法兰外径D" />
        </el-form-item>
        <el-form-item label="法兰孔中心圆直径K" prop="flkzxyzjK">
          <el-input v-model="form.flkzxyzjK" placeholder="请输入法兰孔中心圆直径K" />
        </el-form-item>
        <el-form-item label="法兰孔径L" prop="flkjL">
          <el-input v-model="form.flkjL" placeholder="请输入法兰孔径L" />
        </el-form-item>
        <el-form-item label="法兰孔数n" prop="flksN">
          <el-input v-model="form.flksN" placeholder="请输入法兰孔数n" />
        </el-form-item>
        <el-form-item label="法兰螺栓规格" prop="fllsSpec">
          <el-input v-model="form.fllsSpec" placeholder="请输入法兰螺栓规格" />
        </el-form-item>
        <el-form-item label="法兰厚度C" prop="flhdC">
          <el-input v-model="form.flhdC" placeholder="请输入法兰厚度C" />
        </el-form-item>
        <el-form-item label="法兰密封面尺寸d" prop="flmfmccD">
          <el-input v-model="form.flmfmccD" placeholder="请输入法兰密封面尺寸d" />
        </el-form-item>
        <el-form-item label="法兰台高f" prop="fltgF">
          <el-input v-model="form.fltgF" placeholder="请输入法兰台高f" />
        </el-form-item>
        <el-form-item label="法兰内径系列I" prop="flnj1">
          <el-input v-model="form.flnj1" placeholder="请输入法兰内径系列I" />
        </el-form-item>
        <el-form-item label="法兰内径系列Ⅱ" prop="flnj2">
          <el-input v-model="form.flnj2" placeholder="请输入法兰内径系列Ⅱ" />
        </el-form-item>
        <el-form-item label="法兰理论重量(kg)平面FF系列I" prop="flllzlpm1Ff">
          <el-input v-model="form.flllzlpm1Ff" placeholder="请输入法兰理论重量(kg)平面FF系列I" />
        </el-form-item>
        <el-form-item label="法兰理论重量(kg)平面FF系列Ⅱ" prop="flllzlpm2Ff">
          <el-input v-model="form.flllzlpm2Ff" placeholder="请输入法兰理论重量(kg)平面FF系列Ⅱ" />
        </el-form-item>
        <el-form-item label="法兰理论重量(kg)突面RF系列I" prop="flllzltm1Rf">
          <el-input v-model="form.flllzltm1Rf" placeholder="请输入法兰理论重量(kg)突面RF系列I" />
        </el-form-item>
        <el-form-item label="法兰理论重量(kg)突面RF系列IⅡ" prop="flllzltm2Rf">
          <el-input v-model="form.flllzltm2Rf" placeholder="请输入法兰理论重量(kg)突面RF系列IⅡ" />
        </el-form-item>
        <el-form-item label="法兰盖厚度C" prop="flghdC">
          <el-input v-model="form.flghdC" placeholder="请输入法兰盖厚度C" />
        </el-form-item>
        <el-form-item label="法兰盖理论重量平面FF" prop="flgllzlpmFf">
          <el-input v-model="form.flgllzlpmFf" placeholder="请输入法兰盖理论重量平面FF" />
        </el-form-item>
        <el-form-item label="法兰盖理论重量突面RF" prop="flgllzlpmRf">
          <el-input v-model="form.flgllzlpmRf" placeholder="请输入法兰盖理论重量突面RF" />
        </el-form-item>
        <el-form-item label="材质检验1标准" prop="checkBz1">
          <el-input v-model="form.checkBz1" placeholder="请输入材质检验1标准" />
        </el-form-item>
        <el-form-item label="材质检验1结果" prop="checkJg1">
          <el-input v-model="form.checkJg1" placeholder="请输入材质检验1结果" />
        </el-form-item>
        <el-form-item label="材质检验2标准" prop="checkBz2">
          <el-input v-model="form.checkBz2" placeholder="请输入材质检验2标准" />
        </el-form-item>
        <el-form-item label="材质检验2结果" prop="checkJg2">
          <el-input v-model="form.checkJg2" placeholder="请输入材质检验2结果" />
        </el-form-item>
        <el-form-item label="材质检验3标准" prop="checkBz3">
          <el-input v-model="form.checkBz3" placeholder="请输入材质检验3标准" />
        </el-form-item>
        <el-form-item label="材质检验3结果" prop="checkJg3">
          <el-input v-model="form.checkJg3" placeholder="请输入材质检验3结果" />
        </el-form-item>
        <el-form-item label="材质检验4标准" prop="checkBz4">
          <el-input v-model="form.checkBz4" placeholder="请输入材质检验4标准" />
        </el-form-item>
        <el-form-item label="材质检验4结果" prop="checkJg4">
          <el-input v-model="form.checkJg4" placeholder="请输入材质检验4结果" />
        </el-form-item>
        <el-form-item label="材质检验5标准" prop="checkBz5">
          <el-input v-model="form.checkBz5" placeholder="请输入材质检验5标准" />
        </el-form-item>
        <el-form-item label="材质检验5结果" prop="checkJg5">
          <el-input v-model="form.checkJg5" placeholder="请输入材质检验5结果" />
        </el-form-item>
        <el-form-item label="材质检验6标准" prop="checkBz6">
          <el-input v-model="form.checkBz6" placeholder="请输入材质检验6标准" />
        </el-form-item>
        <el-form-item label="材质检验6结果" prop="checkJg6">
          <el-input v-model="form.checkJg6" placeholder="请输入材质检验6结果" />
        </el-form-item>
        <el-form-item label="材质检验7标准" prop="checkBz7">
          <el-input v-model="form.checkBz7" placeholder="请输入材质检验7标准" />
        </el-form-item>
        <el-form-item label="材质检验7结果" prop="checkJg7">
          <el-input v-model="form.checkJg7" placeholder="请输入材质检验7结果" />
        </el-form-item>
        <el-form-item label="材质检验8标准" prop="checkBz8">
          <el-input v-model="form.checkBz8" placeholder="请输入材质检验8标准" />
        </el-form-item>
        <el-form-item label="材质检验8结果" prop="checkJg8">
          <el-input v-model="form.checkJg8" placeholder="请输入材质检验8结果" />
        </el-form-item>
        <el-form-item label="材质检验9标准" prop="checkBz9">
          <el-input v-model="form.checkBz9" placeholder="请输入材质检验9标准" />
        </el-form-item>
        <el-form-item label="材质检验9结果" prop="checkJg9">
          <el-input v-model="form.checkJg9" placeholder="请输入材质检验9结果" />
        </el-form-item>
        <el-form-item label="材质检验10标准" prop="checkBz10">
          <el-input v-model="form.checkBz10" placeholder="请输入材质检验10标准" />
        </el-form-item>
        <el-form-item label="材质检验10结果" prop="checkJg10">
          <el-input v-model="form.checkJg10" placeholder="请输入材质检验10结果" />
        </el-form-item>
        <el-form-item label="核定标记" prop="hdFlag">
          <el-input v-model="form.hdFlag" placeholder="请输入核定标记" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" placeholder="请输入备注" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listQualityCheckInfo, getQualityCheckInfo, delQualityCheckInfo, addQualityCheckInfo, updateQualityCheckInfo } from "@/api/business/qualityCheckInfo";

export default {
  name: "QualityCheckInfo",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 质量检验记录表格数据
      qualityCheckInfoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        checkNo: null,
        orderType: null,
        orderId: null,
        productionId: null,
        checkType1: null,
        checkType2: null,
        shDate: null,
        bjDate: null,
        checkDate: null,
        stockId: null,
        stockName: null,
        kuweiCode: null,
        lot: null,
        classId1: null,
        className1: null,
        classId2: null,
        className2: null,
        itemCode: null,
        itemName: null,
        itemId: null,
        spec: null,
        checkBz: null,
        shNum: null,
        kcNum: null,
        sjNum: null,
        cjNum: null,
        hgNum: null,
        bhgNum: null,
        jjfxNum: null,
        ddfxNum: null,
        jfNum: null,
        flNum: null,
        czfpNum: null,
        sczNo: null,
        sczName: null,
        zjyNo: null,
        zjyName: null,
        pdzlState: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询质量检验记录列表 */
    getList() {
      this.loading = true;
      listQualityCheckInfo(this.queryParams).then(response => {
        this.qualityCheckInfoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        factoryName: null,
        factoryCode: null,
        checkNo: null,
        orderType: null,
        orderId: null,
        productionId: null,
        checkType1: null,
        checkType2: null,
        shDate: null,
        bjDate: null,
        checkDate: null,
        stockId: null,
        stockName: null,
        kuweiCode: null,
        lot: null,
        classId1: null,
        className1: null,
        classId2: null,
        className2: null,
        itemCode: null,
        itemName: null,
        itemId: null,
        spec: null,
        checkBz: null,
        shNum: null,
        kcNum: null,
        sjNum: null,
        cjNum: null,
        hgNum: null,
        bhgNum: null,
        jjfxNum: null,
        ddfxNum: null,
        jfNum: null,
        flNum: null,
        czfpNum: null,
        sczNo: null,
        sczName: null,
        zjyNo: null,
        zjyName: null,
        pdzlState: null,
        gctjDn: null,
        ggwj1: null,
        ggwj2: null,
        flwjD: null,
        flkzxyzjK: null,
        flkjL: null,
        flksN: null,
        fllsSpec: null,
        flhdC: null,
        flmfmccD: null,
        fltgF: null,
        flnj1: null,
        flnj2: null,
        flllzlpm1Ff: null,
        flllzlpm2Ff: null,
        flllzltm1Rf: null,
        flllzltm2Rf: null,
        flghdC: null,
        flgllzlpmFf: null,
        flgllzlpmRf: null,
        checkBz1: null,
        checkJg1: null,
        checkBz2: null,
        checkJg2: null,
        checkBz3: null,
        checkJg3: null,
        checkBz4: null,
        checkJg4: null,
        checkBz5: null,
        checkJg5: null,
        checkBz6: null,
        checkJg6: null,
        checkBz7: null,
        checkJg7: null,
        checkBz8: null,
        checkJg8: null,
        checkBz9: null,
        checkJg9: null,
        checkBz10: null,
        checkJg10: null,
        hdFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加质量检验记录";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getQualityCheckInfo(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改质量检验记录";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateQualityCheckInfo(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addQualityCheckInfo(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除质量检验记录编号为"' + ids + '"的数据项？').then(function() {
        return delQualityCheckInfo(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('business/qualityCheckInfo/export', {
        ...this.queryParams
      }, `qualityCheckInfo_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
